home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / BBS-Archive / Comm / AmiTCP30b2.lha / src / netlib / iomode.c < prev    next >
C/C++ Source or Header  |  1994-03-30  |  898b  |  45 lines

  1. RCS_ID_C="$Id: iomode.c,v 1.3 1994/03/30 07:39:20 jraja Exp $";
  2. /*
  3.  * iomode.c --- set file io mode (normal or translated)
  4.  *
  5.  * Author: jraja <Jarno.Rajahalme@hut.fi>
  6.  *
  7.  * This file is part of the AmiTCP/IP Network Support Library.
  8.  *
  9.  * Copyright © 1994 AmiTCP/IP Group, <amitcp-group@hut.fi>
  10.  *                  Helsinki University of Technology, Finland.
  11.  *                  All rights reserved.
  12.  *
  13.  * Created      : Thu Mar 17 21:52:49 1994 jraja
  14.  * Last modified: Wed Mar 30 10:35:45 1994 jraja
  15.  *
  16.  */
  17.  
  18. #include <ios1.h>
  19. #include <stdlib.h>
  20.  
  21. int
  22. iomode(int fd, int mode)
  23. {
  24.   struct UFB *ufb;
  25.  
  26.   /*
  27.    * find the ufb *
  28.    */
  29.   if ((ufb = __chkufb(fd)) == NULL) {
  30.     return -1;
  31.   }
  32.   /*
  33.    * Set the translation mode
  34.    *
  35.    * mode == 0 - translate mode on
  36.    * mode == 1 - translate mode off
  37.    */
  38.   if (mode)
  39.     ufb->ufbflg &= ~UFB_XLAT;
  40.   else
  41.     ufb->ufbflg |= UFB_XLAT;
  42.  
  43.   return 0;
  44. }
  45.